<template>
	<div class="header">
		<span class="iconfont icon-zuojiantou"></span>
		<div class="middle">
			<span class="iconfont icon-sousuokuang"></span>
			<span>输入城市/景点/游玩主题</span>
		</div>
		<div class="right">
			<router-link to="/City">
			<span>{{getcity}}</span>
			<span class="iconfont icon-xiasanjiao"></span>
			</router-link>
		</div>
		
	</div>
</template>

<script>
	// 2.在各组件中引入xx.js文件
	import Pub from '../public.js'
	export default {
		name:'Home-header',
		data() {
			return {
				getcity:''
			}
		},
		methods:{
			huoqucity(){
				// 在B组件中通过$on接收参数和响应时间并接受参数
				Pub.$on("getBmapCity",val=>{
					this.getcity = val;
				})
			}
		},
		mounted(){
			this.huoqucity()
		}
	}
</script>

<style scoped>
	.header{
		width: 100%;
		height:.44rem;
		background: #00afc7;
		display: flex;
		justify-content: space-between;
		align-items: center;
		box-sizing: border-box;
	}
	.icon-zuojiantou{
		color: white;
		margin-left: .1rem;
		margin-right: .1rem;
	}
	.middle{
		flex: 1;
		background: white;
		height: .3rem;
		line-height: .3rem;
		border-radius:.03rem;
		color: #e4e7ea;
		padding-left: .1rem;
		box-sizing: border-box;
	}
	.right{
		height: .44rem;
		line-height: .44rem;
		color: white;
		padding:0rem .11rem;
		font-size:.14rem;
	}
	.icon-xiasanjiao{
		font-size: .14rem;
	}
	a{
		color: white;
	}
</style>
